﻿using Mobile.Controllers;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting.Web;
using Mobile.Models;
using System.Web.Mvc;

namespace Mobile.Tests
{
    
    
    /// <summary>
    ///This is a test class for PartyControllerTest and is intended
    ///to contain all PartyControllerTest Unit Tests
    ///</summary>
    [TestClass()]
    public class PartyControllerTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for PartyController Constructor
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void PartyControllerConstructorTest()
        {
            PartyController target = new PartyController();
            Assert.IsNotNull(target);
        }

        /// <summary>
        ///A test for Create
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void CreateTest()
        {
            PartyController target = new PartyController(); // Initialize PartyController object
            Party party = new Party(); // Initialize a base party
            //party.Description = "This is a test Party";
            ActionResult expected = new System.Web.Mvc.ViewResult(); // Initialize to view we want
            ActionResult actual;
            actual = target.Create(party);
            //We want to make sure we get a view back, so we will test that
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            Assert.AreEqual(expectedType, actualType);
            //Check whether return value is null
            Assert.IsNotNull(actual);
        }

        /// <summary>
        ///A test for Creating a Party
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void CreateTestWithoutParty()
        {
            PartyController target = new PartyController(); // Initialize PartyController object
            ActionResult expected = new System.Web.Mvc.ViewResult(); // Initialize to view we want
            ActionResult actual;
            actual = target.Create();
            //We want to make sure we get a view back, so we will test that
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            Assert.AreEqual(expectedType, actualType);
            //Check whether return value is null
            Assert.IsNotNull(actual);
        }

        /// <summary>
        ///A test for Deleting a party
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void DeleteTest()
        {
            PartyController target = new PartyController(); // Initialize PartyController object
            int partyID = 0; // Initialize a base party
            ActionResult expected = new System.Web.Mvc.ViewResult(); // Initialize to view we want
            ActionResult actual;
            actual = target.Delete(partyID);
            //We want to make sure we get a view back, so we will test that
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            Assert.AreEqual(expectedType, actualType);
            //Check whether return value is null
            Assert.IsNotNull(actual);
        }

        /// <summary>
        ///A test for DeleteConfirmed
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void DeleteConfirmedTest()
        {
            PartyController target = new PartyController(); // Initialize PartyController object
            int partyID = 0; // Initialize a base party
            ActionResult expected = new System.Web.Mvc.ViewResult(); // Initialize to view we want
            ActionResult actual;
            //make sure testing DeleteConfirmed
            actual = target.DeleteConfirmed(partyID);
            //We want to make sure we get a view back, so we will test that
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            Assert.AreEqual(expectedType, actualType);
            //Check whether return value is null
            Assert.IsNotNull(actual);
        }

        /// <summary>
        ///A test for Details
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void DetailsTest()
        {
            PartyController target = new PartyController(); // Initialize PartyController object
            int partyID = 0; // Initialize a base party
            ActionResult expected = new System.Web.Mvc.ViewResult(); // Initialize to view we want
            ActionResult actual;
            actual = target.Details(partyID);
            //We want to make sure we get a view back, so we will test that
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            Assert.AreEqual(expectedType, actualType);
            //Check whether return value is null
            Assert.IsNotNull(actual);
        }

        /// <summary>
        ///A test for Dispose
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        [DeploymentItem("Mobile.dll")]
        public void DisposeTest()
        {
            PartyController_Accessor target = new PartyController_Accessor(); // Initializing Accessor
            bool disposing = false; // Initialize to fales
            target.Dispose(disposing);
            Assert.Inconclusive("Currently not using this method but will have to verify a party is disposed.");
        }

        /// <summary>
        ///A test for Edit
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void EditTest()
        {
            PartyController target = new PartyController(); // Initialize PartyController object
            int partyID = 0; // Initialize a base party
            ActionResult expected = new System.Web.Mvc.ViewResult(); // Initialize to view we want
            ActionResult actual;
            actual = target.Edit(partyID);
            //We want to make sure we get a view back, so we will test that
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            Assert.AreEqual(expectedType, actualType);
            //Check whether return value is null
            Assert.IsNotNull(actual);
        }

        /// <summary>
        ///A test for Edit
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void EditTestWithPartyObject()
        {
            PartyController target = new PartyController(); // Initialize PartyController object
            Party party = new Party(); // Initialize a base party
            //party.Description = "This is a test Party";
            ActionResult expected = new System.Web.Mvc.ViewResult(); // Initialize to view we want
            ActionResult actual;
            actual = target.Edit(party);
            //We want to make sure we get a view back, so we will test that
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            Assert.AreEqual(expectedType, actualType);
            //Check whether return value is null
            Assert.IsNotNull(actual);
        }

        /// <summary>
        ///A test for Index
        ///</summary>
        [TestMethod()]
        //[HostType("ASP.NET")]
        //[AspNetDevelopmentServerHost("C:\\Users\\Jim\\Documents\\Senior Year\\CS 638\\CurrentSolution\\TFS_Solution\\Mobile\\Mobile", "/")]
        [UrlToTest("http://localhost:1034/")]
        public void IndexTest()
        {
            PartyController target = new PartyController(); // Initialize PartyController object
            ActionResult expected = new System.Web.Mvc.ViewResult(); // Initialize to view we want
            ActionResult actual;
            actual = target.Index();
            //We want to make sure we get a view back, so we will test that
            Type expectedType = expected.GetType();
            Type actualType = actual.GetType();
            Assert.AreEqual(expectedType, actualType);
            //Check whether return value is null
            Assert.IsNotNull(actual);
        }
    }
}
